package com.telecom.restaurant.service;

import com.telecom.restaurant.util.EncryptUtil;
import org.springframework.stereotype.Service;

/**
 * Created by qiqi on 2019/12/2.
 */
@Service
public class AdminService {


    public String generateAdminToken(Long userId, Long restaurantId) {

        String sourceString = userId + "|" + restaurantId + "|" + System.currentTimeMillis();

        String encrypt = EncryptUtil.encrypt(sourceString);

        return encrypt;
    }


    public String generateUseToken(Long userId, String mobile) {

        String sourceString = userId + "|" + mobile + "|" + System.currentTimeMillis();

        String encrypt = EncryptUtil.encrypt(sourceString);

        return encrypt;
    }

}
